import { getTrain } from '@utils/WeStudyUtil';
import { Navigate } from 'react-router-dom';

export default function AuthTrain({ children }: any) {
  const tokenCookie = getTrain();
  console.log(tokenCookie, !tokenCookie, tokenCookie === "true");
  if (!tokenCookie) {
    return children;
  } else {
    return <Navigate to="/study/train/problem"></Navigate>;
  }
}